import { WebPlugin } from '@capacitor/core'
import type { SystemOverlayPlugin } from './SystemOverlayPlugin'

export class SystemOverlayWeb extends WebPlugin implements SystemOverlayPlugin {
  async checkOverlayPermission(): Promise<{ hasPermission: boolean }> {
    // Web平台不支持系统级悬浮窗
    return { hasPermission: false }
  }

  async requestOverlayPermission(): Promise<{ granted: boolean }> {
    // Web平台不支持系统级悬浮窗
    return { granted: false }
  }

  async showSystemOverlay(): Promise<void> {
    throw new Error('System overlay not supported on web platform')
  }

  async hideSystemOverlay(): Promise<void> {
    throw new Error('System overlay not supported on web platform')
  }

  async updateOverlayPosition(): Promise<void> {
    throw new Error('System overlay not supported on web platform')
  }

  async getAndClearPendingToggle(): Promise<{ pending: boolean }> {
    return { pending: false }
  }

  async getAndClearPendingInput(): Promise<{ text?: string }> {
    return {}
  }

  async setAiConfig(_options: { configJson: string }): Promise<void> {
    // Web 平台不需要同步 AI 配置
    return
  }

  async getOverlayAiConfig(): Promise<{ configJson?: string }> {
    return {}
  }
}
